﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Critterz
{
    // Make this a singleton
    public class Map
    {
        private Map()
        { }

        private static Map instance { get; set; }

        public List<Organism> organisms { get; private set; }

        public static Map getInstance()
        {
            if (instance == null)
            {
                instance = new Map();
            }
            return instance;
        }

        public bool addOrganism(MapLocation mapLoc, Organism organism)
        {
            // if mapLoc exists within bounds && is habitable, continue, else return false.
            if (!organisms.Contains(organism))
            {
                organisms.Add(organism);
                return true;
            }
            return false;
        }

        public bool removeOrganism(Organism organism)
        {
            if (organisms.Remove(organism))
            {
                return true;
            }
            return false;
        }

    }

    public class MapLocation
    {
        public int x { get; set; }
        public int y { get; set; }
    }
}
